package com.xintai.system.controller;

import java.util.List;

import com.xintai.system.domain.setother.ErpOtherList;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xintai.common.annotation.Log;
import com.xintai.common.core.controller.BaseController;
import com.xintai.common.core.domain.AjaxResult;
import com.xintai.common.enums.BusinessType;
import com.xintai.system.domain.setother.ErpOther;
import com.xintai.system.service.IErpOtherService;
import com.xintai.common.core.page.TableDataInfo;

/**
 * 磅盈设置Controller
 * 
 * @author xintai
 * @date 2021-01-15
 */
@RestController
@RequestMapping("/system/other")
public class ErpOtherController extends BaseController
{
    @Autowired
    private IErpOtherService erpOtherService;

    /**
     * 查询磅盈设置列表
     */
    @PreAuthorize("@ss.hasPermi('system:other:list')")
    @GetMapping("/list")
    public AjaxResult list(ErpOther erpOther)
    {
        return AjaxResult.success(erpOtherService.selectBangYingList());
    }

    /**
     * 新增磅盈设置
     */
    @PreAuthorize("@ss.hasPermi('system:other:add')")
    @Log(title = "磅盈设置", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody ErpOtherList erpOtherList)
    {
        return toAjax(erpOtherService.insertBangYing(erpOtherList));
    }
}
